SHELL = @SHELL@
CC    = @CC@
F77   = @F77@
CXX   = @CXX@
F90   = @F90@
MAKE  = @MAKE@
LIBS  = @LIBS@
MPIRUN= @MPIRUN@
NP_ARG= @NP_ARG@

all: all-redirect

PROGRAMS = 

GA_SOURCES = ga_acc.c ga_access.c ga_create.c ga_free.c ga_get.c ga_mutex.c \
	     ga_mutex1.c ga_put.c ga_read_inc.c
LIST_SOURCES = findelm.c findelm_dyn.c findelm_shmem.c insertelm_dyn.c \
	     unilist.c unilist_util.c
NXVAL_SOURCES = nxtval-simple.c nxtval_attr_free.c nxtval_free.c nxtval_setup.c
SOURCES = ${GA_SOURCES} ${LIST_SOURCES} ${NXVAL_SOURCES}

all-redirect: ${PROGRAMS}

clean:
	rm -f *.o ${PROGRAMS} *~ PI*

.SUFFIXES: .o .c .f .cc .f90
.c:
	${CC} ${CFLAGS} -o $* $< ${LIBS} 
.c.o:
	${CC} ${CFLAGS} -c $<
.f:
	${F77} ${FFLAGS} -o $* $< ${LIBS}
.f.o:
	${F77} ${FFLAGS} -c $<
.f90:
	${F90} ${F90FLAGS} -o $* $< ${LIBS}
.cc:
	${CXX} ${CXXFLAGS} -o $* $< ${LIBS} 

run: ${PROGRAMS}
	${MPIRUN} ${NP_ARG} 4 xxx

sources:
	@echo ${SOURCES}
